package com.live.activity;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.live.common.LiveImageHelper;
import com.live.task.LiveMember;

public class LiveMemberActivity extends LiveBaseActivity {

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		/* 获取Intent中的Bundle对象 */
		Bundle bundle = this.getIntent().getExtras();

		String matchCategory = bundle.getString("matchCategory");

		if ("1".equals(matchCategory)) {
			setContentView(R.layout.live_member_b);

			String macthName = bundle.getString("macthName");
			if (macthName.indexOf("NBA") >= 0) {
				ImageView pic = (ImageView) findViewById(R.id.pic);
				LiveImageHelper image = new LiveImageHelper(pic);
				image.execute("http://www.sinaimg.cn/ty/nba/player/2008/" + bundle.getString("id") + ".jpg");
			}
		} else if ("2".equals(matchCategory)) {
			setContentView(R.layout.live_member_f);
		}

		TextView name = (TextView) findViewById(R.id.name);
		name.setText(bundle.getString("name"));

		String[] teams = bundle.getString("team").split(":");
		TextView team = (TextView) findViewById(R.id.team);
		team.setText(teams[1]);
		bundle.putString("team", teams[0]);

		LinearLayout live_member = (LinearLayout) findViewById(R.id.live_member);

		LiveMember memberTask = new LiveMember(live_member);
		memberTask.execute(bundle);
	}
}